package receiver;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.net.ServerSocket;
import java.net.Socket;

import job.Job;
import job.JobEnvelope;

public class JobReceiver {
	
	public static void main (String args[]) {
		try {
			ServerSocket ss = new ServerSocket(31337);
			Socket s = ss.accept();
			ObjectInputStream ois = new ObjectInputStream(s.getInputStream());
			JobEnvelope je = (JobEnvelope) ois.readObject();
			je.job.run();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
